﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
	驰骋工作流引擎ccbpm6
</title>
    <script language="JavaScript" src="../../../Comm/JScript.js" type="text/javascript"></script>
    <script language="JavaScript" src="../../../Comm/JS/Calendar/WdatePicker.js" defer="defer"type="text/javascript"></script>
    <link href="../../../../DataUser/Style/ccbpm.css" rel="stylesheet" type="text/css" /><link rel="shortcut icon" href="../../../Img/ccbpm.ico" type="image/x-icon" />
    <link  href="../../../Comm/Style/CommStyle.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../../Scripts/easyUI/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/easyUI/jquery-1.8.0.min.js" type="text/javascript"></script>
    <script src="../../../Scripts/easyUI/jquery.easyui.min.js" type="text/javascript"></script>
   
    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="../../../Scripts/config.js"></script>
    <script type="text/javascript" src="../../../Comm/Gener.js"></script>
    <script type="text/javascript" src="../../../Scripts/QueryString.js" ></script>

      <script type="text/javascript" >
          //页面启动函数.
          $(function () {
             var ens = new Entities("BP.Sys.MapExts", "FK_MapData", GetQueryString("FK_MapData"), "ExtType", GetQueryString("ExtType"));
              if (ens.length > 0) {
                 var jsonEn = ens[0];
                  $("#TB_Tag").val(jsonEn.Tag);
              }
          });
          //执行保存
          function save_Tag() {
              var MyPK = GetQueryString("ExtType") + "_" + GetQueryString("FK_MapData");
              var enMapExt = new Entity("BP.Sys.MapExt");
              var Tag = document.getElementById("TB_Tag").value;
              enMapExt.MyPK = MyPK;
              enMapExt.Tag = Tag;
              enMapExt.FK_MapData = GetQueryString("FK_MapData");
              enMapExt.ExtType = GetQueryString("ExtType");
              if (enMapExt.Save() != 0) {
                  alert("保存成功.");
              } 
              else {
                  alert("保存失败.");
              };             
          }
</script>

    <base target="_self" />
    <script type="text/javascript">
        function RSize() {
            if (document.body.scrollWidth > (window.screen.availWidth - 100)) {
                window.dialogWidth = (window.screen.availWidth - 100).toString() + "px"
            } else {
                window.dialogWidth = (document.body.scrollWidth + 50).toString() + "px"
            }

            if (document.body.scrollHeight > (window.screen.availHeight - 70)) {
                window.dialogHeight = (window.screen.availHeight - 50).toString() + "px"
            } else {
                window.dialogHeight = (document.body.scrollHeight + 115).toString() + "px"
            }
            window.dialogLeft = ((window.screen.availWidth - document.body.clientWidth) / 2).toString() + "px"
            window.dialogTop = ((window.screen.availHeight - document.body.clientHeight) / 2).toString() + "px"
        }

        function NoSubmit(ev) {
            if (window.event.srcElement.tagName == "TEXTAREA")
                return true;

            if (ev.keyCode == 13) {
                window.event.keyCode = 9;
                ev.keyCode = 9;
                return true;
            }
            return true;
        }
        </script>
</head>
<body class="easyui-layout">
<form method="post" action="" id="form1" onkeypress="NoSubmit(event);">
    <div id="mainPanel" class="mainPanel">
        
    <table class='Table' cellspacing='0' cellpadding='0' border='0' style='width:100%' >
<tr>
<td class='GroupTitle'>主表SQL设置<div style='float:right' ><a href='' target="_blank"><img src='/WF/Img/Help.gif'>帮助</a></div></td>
</tr>
<tr>
<td>
<textarea name="TB_Tag" rows="7" cols="70" id="TB_Tag" style="width:99%;">
</textarea>
<br/>说明:填充主表的sql,表达式里支持@变量与约定的公用变量。 
<br/>比如: SELECT No,Name,Tel FROM Port_Emp WHERE No='@WebUser.No' , 如果列名与开始表单字段名相同，就会自动给值。
</td>
</tr>
<tr>
<td ><a id="Btn_Save" class="easyui-linkbutton" onclick="save_Tag()">保存</a></td>
</tr>
</table>

    </div>
    </form>
</body>
</html>